package com.course.android.activity.ac;

import android.content.Intent;
import android.net.http.SslError;
import android.view.View;
import android.webkit.SslErrorHandler;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import androidx.appcompat.widget.Toolbar;

import com.course.android.R;
import com.course.android.activity.base.BaseActivity;

public class WebviewActivity extends BaseActivity {
    Toolbar toolbar;
    WebView webView;
    @Override
    protected void initView() {
        webView = findViewById(R.id.webView);
        toolbar = findViewById(R.id.toolbar);
        toolbar.setTitle(getIntent().getStringExtra("title"));
        toolbar.setNavigationIcon(R.mipmap.back);
        webView.loadUrl(getIntent().getStringExtra("url"));
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    protected void initData() {

    }

    @Override
    protected int bindLayout() {
        return R.layout.activity_webview;
    }

    @Override
    protected void onActivityResultCallBack(Integer reqCode, Intent data) {

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        webView.destroy();
    }
}

